1. Field
The present disclosure relates generally to an improved data processing system and, more particularly, to a method and apparatus for tracking instructions. Still, more particularly, the present disclosure relates to a method and apparatus for tracking a flow history of a program using compression.
2. Description of the Related Art
Optimizing compilers and runtime code optimizers provide significant performance benefits. These optimizations may include performing code transformations based on a runtime profile of a program. One of the most useful runtime profiles is capturing the control flow history of a program. The control flow history is the order in which individual instructions or function calls of a program were executed. Knowledge of the control flow history can drive powerful program optimizations, such as function in-lining, code cloning, superblock formation, prefetch insertion, among other applications.
A control flow history of a program can be represented by a list of the branch instructions that were taken in its execution. Branch instructions are points in a program where a choice is made as to which of two or more paths should be followed. Knowing the outcome of each branch instruction allows a code optimizer to determine the sequence of instructions that were followed in the runtime execution of the program code.